import request from '@/utils/request'

const cabinetApi = {
  lists: '/api/v2/cabinets',
  logs: '/api/v2/exchange-logs'
}

export function getLogsList () {
  return request({
    url: cabinetApi.logs,
    method: 'get'
  })
}

export function cabinetLists (parameter) {
  return request({
    url: cabinetApi.lists,
    method: 'get',
    params: parameter
  })
}

export function regCabinet (id, data) {
  return request({
    url: cabinetApi.lists + '/' + id,
    method: 'post',
    data: data
  })
}

export function saveCabinet (id, data) {
  return request({
    url: cabinetApi.lists + '/' + id,
    method: 'put',
    data: data
  })
}

export function cabinetDelete (id) {
  return request({
    url: cabinetApi.lists + '/' + id,
    method: 'delete'
  })
}
